
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: class conn</title>
</head><body bgcolor="#f0f0f8">
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><strong>ec.conn</strong> = <a name="ec.conn">class conn</a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Remote-control&nbsp;aMule(d)&nbsp;using&nbsp;"External&nbsp;connections.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="conn-__del__"><strong>__del__</strong></a>(self)</dt></dl>

<dl><dt><a name="conn-__init__"><strong>__init__</strong></a>(self, password, host<font color="#909090">='localhost'</font>, port<font color="#909090">=4712</font>, app<font color="#909090">='pyEC'</font>, ver<font color="#909090">='0.5'</font>)</dt><dd><tt>Connect&nbsp;to&nbsp;a&nbsp;running&nbsp;aMule(d)&nbsp;core.<br>
&nbsp;<br>
Parameters:<br>
-&nbsp;password&nbsp;(required):&nbsp;Password&nbsp;for&nbsp;the&nbsp;connection<br>
-&nbsp;host&nbsp;(default:&nbsp;"localhost"):&nbsp;Host&nbsp;where&nbsp;core&nbsp;is&nbsp;running<br>
-&nbsp;port&nbsp;(default:&nbsp;4712):&nbsp;Port&nbsp;where&nbsp;core&nbsp;is&nbsp;running<br>
-&nbsp;app&nbsp;(default&nbsp;"pyEC"):&nbsp;application&nbsp;name&nbsp;transmitted&nbsp;on&nbsp;login<br>
-&nbsp;ver&nbsp;(default:&nbsp;"0.5"):&nbsp;application&nbsp;version</tt></dd></dl>

<dl><dt><a name="conn-add_link"><strong>add_link</strong></a>(self, link)</dt><dd><tt>Add&nbsp;link&nbsp;to&nbsp;aMule&nbsp;core.<br>
&nbsp;<br>
Returns&nbsp;True&nbsp;when&nbsp;the&nbsp;link&nbsp;was&nbsp;added&nbsp;and&nbsp;False&nbsp;if&nbsp;the&nbsp;link&nbsp;is&nbsp;invalid.</tt></dd></dl>

<dl><dt><a name="conn-connect"><strong>connect</strong></a>(self)</dt><dd><tt>Connect&nbsp;remote&nbsp;core&nbsp;to&nbsp;activated&nbsp;networks.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;tuple&nbsp;with&nbsp;a&nbsp;boolean&nbsp;indicating&nbsp;success&nbsp;and&nbsp;a&nbsp;list&nbsp;of&nbsp;strings<br>
&nbsp;with&nbsp;status&nbsp;messages.</tt></dd></dl>

<dl><dt><a name="conn-connect_kad"><strong>connect_kad</strong></a>(self)</dt><dd><tt>Connect&nbsp;remote&nbsp;core&nbsp;to&nbsp;kademlia&nbsp;network.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;boolean&nbsp;indicating&nbsp;success.</tt></dd></dl>

<dl><dt><a name="conn-connect_server"><strong>connect_server</strong></a>(self)</dt><dd><tt>Connect&nbsp;remote&nbsp;core&nbsp;to&nbsp;eD2k&nbsp;network.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;boolean&nbsp;indicating&nbsp;success.</tt></dd></dl>

<dl><dt><a name="conn-disconnect"><strong>disconnect</strong></a>(self)</dt><dd><tt>Disconnect&nbsp;remote&nbsp;core&nbsp;from&nbsp;networks.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;tuple&nbsp;with&nbsp;a&nbsp;boolean&nbsp;indicating&nbsp;success&nbsp;and&nbsp;a&nbsp;list&nbsp;of&nbsp;strings<br>
&nbsp;with&nbsp;status&nbsp;messages.</tt></dd></dl>

<dl><dt><a name="conn-disconnect_kad"><strong>disconnect_kad</strong></a>(self)</dt><dd><tt>Disconnect&nbsp;remote&nbsp;core&nbsp;from&nbsp;kademlia&nbsp;network.</tt></dd></dl>

<dl><dt><a name="conn-disconnect_server"><strong>disconnect_server</strong></a>(self)</dt><dd><tt>Disconnect&nbsp;remote&nbsp;core&nbsp;from&nbsp;eD2k&nbsp;network.</tt></dd></dl>

<dl><dt><a name="conn-get_connstate"><strong>get_connstate</strong></a>(self)</dt><dd><tt>Get&nbsp;connection&nbsp;status&nbsp;information&nbsp;from&nbsp;remore&nbsp;core.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;following&nbsp;keys:<br>
-&nbsp;"ed2k":&nbsp;ed2k&nbsp;network&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"connected",&nbsp;"connecting",&nbsp;"Not&nbsp;connected"<br>
-&nbsp;"kad":&nbsp;kademlia&nbsp;network&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"connected",&nbsp;"Not&nbsp;connected",&nbsp;"Not&nbsp;running"<br>
-&nbsp;"server_addr":&nbsp;server&nbsp;address&nbsp;in&nbsp;ip:port&nbsp;format<br>
-&nbsp;"ed2k_id":&nbsp;identification&nbsp;number&nbsp;for&nbsp;the&nbsp;ed2k&nbsp;network<br>
-&nbsp;"client_id":&nbsp;identification&nbsp;number&nbsp;for&nbsp;the&nbsp;kademlia&nbsp;network<br>
-&nbsp;"id":&nbsp;connection&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"LowID",&nbsp;"HighID",&nbsp;""<br>
-&nbsp;"kad_firewall":&nbsp;kademlia&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"ok",&nbsp;"firewalled",&nbsp;""</tt></dd></dl>

<dl><dt><a name="conn-get_shared"><strong>get_shared</strong></a>(self)</dt><dd><tt>Get&nbsp;list&nbsp;of&nbsp;shared&nbsp;files.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;shared&nbsp;files.&nbsp;The&nbsp;data&nbsp;for&nbsp;a&nbsp;file&nbsp;is&nbsp;stored&nbsp;in&nbsp;a<br>
&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;following&nbsp;keys:<br>
-&nbsp;"name":&nbsp;file&nbsp;name<br>
-&nbsp;"size":&nbsp;size&nbsp;in&nbsp;Bytes<br>
-&nbsp;"link":&nbsp;eD2k&nbsp;link&nbsp;to&nbsp;the&nbsp;file<br>
-&nbsp;"hash":&nbsp;file&nbsp;hash&nbsp;stored&nbsp;in&nbsp;16&nbsp;Byte<br>
-&nbsp;"prio":&nbsp;upload&nbsp;priority,&nbsp;Auto&nbsp;is&nbsp;prefixed&nbsp;by&nbsp;1,&nbsp;e.g.&nbsp;12&nbsp;is&nbsp;Auto&nbsp;(High)<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;4:&nbsp;Very&nbsp;Low<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;0:&nbsp;Low<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;1:&nbsp;Normal<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;2:&nbsp;High<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;3:&nbsp;Very&nbsp;High<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;6:&nbsp;Release<br>
-&nbsp;"aich":&nbsp;file's&nbsp;AICH&nbsp;hash&nbsp;(see:&nbsp;<a href="http://wiki.amule.org/index.php/AICH">http://wiki.amule.org/index.php/AICH</a>)<br>
-&nbsp;"part_status":&nbsp;unknown<br>
-&nbsp;"uploaded":&nbsp;Bytes&nbsp;uploaded&nbsp;during&nbsp;the&nbsp;current&nbsp;session<br>
-&nbsp;"uploaded_total":&nbsp;total&nbsp;Bytes&nbsp;uploaded<br>
-&nbsp;"requests":&nbsp;number&nbsp;of&nbsp;requests&nbsp;for&nbsp;this&nbsp;file&nbsp;during&nbsp;the&nbsp;current&nbsp;session<br>
-&nbsp;"requests_total":&nbsp;total&nbsp;number&nbsp;of&nbsp;requests&nbsp;for&nbsp;this&nbsp;file<br>
-&nbsp;"accepted":&nbsp;number&nbsp;of&nbsp;accepted&nbsp;requests&nbsp;for&nbsp;this&nbsp;file&nbsp;during&nbsp;the&nbsp;current&nbsp;session<br>
-&nbsp;"accepted_total":&nbsp;total&nbsp;number&nbsp;of&nbsp;accepted&nbsp;requests&nbsp;for&nbsp;this&nbsp;file</tt></dd></dl>

<dl><dt><a name="conn-get_status"><strong>get_status</strong></a>(self)</dt><dd><tt>Get&nbsp;status&nbsp;information&nbsp;from&nbsp;remote&nbsp;core.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;following&nbsp;keys:<br>
-&nbsp;"ul_speed":&nbsp;upload&nbsp;speed&nbsp;in&nbsp;Bytes/s<br>
-&nbsp;"dl_speed":&nbsp;download&nbsp;speed&nbsp;in&nbsp;Bytes/s<br>
-&nbsp;"ul_limit":&nbsp;upload&nbsp;limit,&nbsp;0&nbsp;is&nbsp;unlimited<br>
-&nbsp;"dl_limit":&nbsp;download&nbsp;limit,&nbsp;0&nbsp;is&nbsp;unlimited<br>
-&nbsp;"queue_len":&nbsp;number&nbsp;of&nbsp;clients&nbsp;waiting&nbsp;in&nbsp;the&nbsp;upload&nbsp;queue<br>
-&nbsp;"src_count":&nbsp;number&nbsp;of&nbsp;download&nbsp;sources<br>
-&nbsp;"ed2k_users":&nbsp;users&nbsp;in&nbsp;the&nbsp;eD2k&nbsp;network<br>
-&nbsp;"kad_users":&nbsp;users&nbsp;in&nbsp;the&nbsp;kademlia&nbsp;network<br>
-&nbsp;"ed2k_files":&nbsp;files&nbsp;in&nbsp;the&nbsp;eD2k&nbsp;network<br>
-&nbsp;"kad_files":&nbsp;files&nbsp;in&nbsp;the&nbsp;kademlia&nbsp;network<br>
-&nbsp;"connstate":&nbsp;connection&nbsp;status,&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;following&nbsp;keys:<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"ed2k":&nbsp;ed2k&nbsp;network&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"connected",&nbsp;"connecting",&nbsp;"Not&nbsp;connected"<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"kad":&nbsp;kademlia&nbsp;network&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"connected",&nbsp;"Not&nbsp;connected",&nbsp;"Not&nbsp;running"<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"server_addr":&nbsp;server&nbsp;address&nbsp;in&nbsp;ip:port&nbsp;format<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"ed2k_id":&nbsp;identification&nbsp;number&nbsp;for&nbsp;the&nbsp;ed2k&nbsp;network<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"client_id":&nbsp;identification&nbsp;number&nbsp;for&nbsp;the&nbsp;kademlia&nbsp;network<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"id":&nbsp;connection&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"LowID",&nbsp;"HighID",&nbsp;""<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;"kad_firewall":&nbsp;kademlia&nbsp;status.&nbsp;possible&nbsp;values:&nbsp;"ok",&nbsp;"firewalled",&nbsp;""</tt></dd></dl>

<dl><dt><a name="conn-receive_packet"><strong>receive_packet</strong></a>(self)</dt></dl>

<dl><dt><a name="conn-reload_ipfilter"><strong>reload_ipfilter</strong></a>(self)</dt><dd><tt>Reload&nbsp;ipfilter&nbsp;on&nbsp;remote&nbsp;core.</tt></dd></dl>

<dl><dt><a name="conn-reload_shared"><strong>reload_shared</strong></a>(self)</dt><dd><tt>Reload&nbsp;shared&nbsp;files&nbsp;on&nbsp;remote&nbsp;core.</tt></dd></dl>

<dl><dt><a name="conn-search"><strong>search</strong></a>(self, type, keywords)</dt><dd><tt>Start&nbsp;a&nbsp;search.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;tuple&nbsp;consisting&nbsp;of&nbsp;a&nbsp;boolean&nbsp;value&nbsp;indicating&nbsp;success&nbsp;and<br>
a&nbsp;string&nbsp;with&nbsp;aMule's&nbsp;answer.<br>
&nbsp;<br>
Type&nbsp;is&nbsp;one&nbsp;of&nbsp;local&nbsp;(0x00),&nbsp;global&nbsp;(0x01)&nbsp;and&nbsp;kad&nbsp;(0x02),&nbsp;denoting&nbsp;the<br>
&nbsp;scope&nbsp;of&nbsp;the&nbsp;search.<br>
"local"&nbsp;queries&nbsp;only&nbsp;the&nbsp;connected&nbsp;server,&nbsp;"global"&nbsp;all&nbsp;servers&nbsp;in&nbsp;the<br>
&nbsp;server&nbsp;list&nbsp;and&nbsp;"kad"&nbsp;starts&nbsp;a&nbsp;search&nbsp;in&nbsp;the&nbsp;kad&nbsp;network.<br>
Usage&nbsp;of&nbsp;the&nbsp;helper&nbsp;functions&nbsp;"search_local",&nbsp;"search_global"&nbsp;and<br>
&nbsp;"search_kad"&nbsp;is&nbsp;recommended.<br>
&nbsp;<br>
Keywords&nbsp;is&nbsp;a&nbsp;string&nbsp;of&nbsp;words&nbsp;for&nbsp;which&nbsp;to&nbsp;search.</tt></dd></dl>

<dl><dt><a name="conn-search_global"><strong>search_global</strong></a>(self, keywords)</dt><dd><tt>Start&nbsp;a&nbsp;kad&nbsp;search.<br>
&nbsp;<br>
See&nbsp;function&nbsp;"search"&nbsp;for&nbsp;further&nbsp;details.</tt></dd></dl>

<dl><dt><a name="conn-search_kad"><strong>search_kad</strong></a>(self, keywords)</dt><dd><tt>Start&nbsp;a&nbsp;kad&nbsp;search.<br>
&nbsp;<br>
See&nbsp;function&nbsp;"search"&nbsp;for&nbsp;further&nbsp;details.</tt></dd></dl>

<dl><dt><a name="conn-search_local"><strong>search_local</strong></a>(self, keywords)</dt><dd><tt>Start&nbsp;a&nbsp;kad&nbsp;search.<br>
&nbsp;<br>
See&nbsp;function&nbsp;"search"&nbsp;for&nbsp;further&nbsp;details.</tt></dd></dl>

<dl><dt><a name="conn-search_progress"><strong>search_progress</strong></a>(self)</dt><dd><tt>Doesn't&nbsp;work&nbsp;correctly,&nbsp;don't&nbsp;use&nbsp;it.</tt></dd></dl>

<dl><dt><a name="conn-search_results"><strong>search_results</strong></a>(self)</dt><dd><tt>Get&nbsp;results&nbsp;of&nbsp;last&nbsp;search.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;search&nbsp;results.&nbsp;The&nbsp;data&nbsp;for&nbsp;a&nbsp;search&nbsp;result&nbsp;is<br>
&nbsp;stored&nbsp;in&nbsp;a&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;following&nbsp;keys:<br>
-&nbsp;"name":&nbsp;file&nbsp;name<br>
-&nbsp;"size":&nbsp;size&nbsp;in&nbsp;Bytes<br>
-&nbsp;"hash":&nbsp;file&nbsp;hash&nbsp;stored&nbsp;in&nbsp;16&nbsp;Byte<br>
-&nbsp;"sources":&nbsp;number&nbsp;of&nbsp;clients&nbsp;sharing&nbsp;the&nbsp;file<br>
-&nbsp;"sources_complete":&nbsp;number&nbsp;of&nbsp;clients&nbsp;sharing&nbsp;all&nbsp;parts&nbsp;of&nbsp;the&nbsp;file</tt></dd></dl>

<dl><dt><a name="conn-send_and_receive_packet"><strong>send_and_receive_packet</strong></a>(self, data)</dt></dl>

<dl><dt><a name="conn-send_packet"><strong>send_packet</strong></a>(self, data)</dt></dl>

<dl><dt><a name="conn-shutdown"><strong>shutdown</strong></a>(self)</dt><dd><tt>Shutdown&nbsp;remote&nbsp;core</tt></dd></dl>

</td></tr></table>
</body></html>